---
title: 'AWS X-Ray'
description: 'Configuring the AWS X-Ray backend (Managed)'
sidebarTitle: 'AWS X-Ray'
icon: 'signal-stream'
---

### Getting Started

<img src="https://d15jtxgb40qetw.cloudfront.net/awsxray.svg" alt="xray" className="not-prose h-20" />

{/*
    Add custom content here (under this comment)...

    e.g.

    **Creating Account**<br />
    Go to the **[🔗 website](https://odigos.io) > Account** and click **Sign Up**

    **Obtaining Access Token**<br />
    Go to **⚙️ > Access Tokens** and click **Create New**

    !! Do not remove this comment, this acts as a key indicator in `docs/sync-dest-doc.py` !!
    !! START CUSTOM EDIT !!
*/}

import AwsCredentials from '/snippets/aws-credentials.mdx';

<AwsCredentials />

**Setting up the IAM policy**

```json
{
  "Version": "2012-10-17",
  "Statement": {
    "Effect": "Allow",
    "Action": [
      "xray:PutTraceSegments",
      "xray:PutTelemetryRecords"
    ],
    "Resource": [
      "*"
    ]
  }
}
```

{/*
    !! Do not remove this comment, this acts as a key indicator in `docs/sync-dest-doc.py` !!
    !! END CUSTOM EDIT !!
*/}

### Configuring Destination Fields

<Accordion title="Supported Signals:">
  ✅ Traces
  ❌ Metrics
  ❌ Logs
</Accordion>

- **AWS_XRAY_REGION** `string` : Region. Send segments to AWS X-Ray service in a specific region.
  - This field is optional
- **AWS_XRAY_ENDPOINT** `string` : Endpoint. Optionally override the default X-Ray service endpoint.
  - This field is optional
- **AWS_XRAY_PROXY_ADDRESS** `string` : Proxy Address. Upload segments to AWS X-Ray through a proxy.
  - This field is optional
- **AWS_XRAY_RESOURCE_ARN** `string` : Resource ARN. Amazon Resource Name (ARN) of the AWS resource running the collector.
  - This field is optional
- **AWS_XRAY_ROLE_ARN** `string` : Role ARN. IAM role to upload segments to a different account.
  - This field is optional
- **AWS_XRAY_EXTERNAL_ID** `string` : External ID. Shared identitier used when assuming an IAM role in an external AWS account.
  - This field is optional
- **AWS_XRAY_LOG_GROUPS** `string[]` : Log Groups. List of log group names for CloudWatch.
  - This field is optional
- **AWS_XRAY_DISABLE_SSL** `boolean` : Disable SSL Verification. Enable or disable TLS certificate verification.
  - This field is optional and defaults to `False`
- **AWS_XRAY_LOCAL_MODE** `boolean` : Local Mode. Local mode to skip EC2 instance metadata check.
  - This field is optional and defaults to `False`
- **AWS_XRAY_TELEMETRY_ENABLED** `boolean` : Telemetry - Enabled. Whether telemetry collection is enabled at all.
  - This field is optional and defaults to `False`
- **AWS_XRAY_TELEMETRY_INCLUDE_METADATA** `boolean` : Telemetry - Include Metadata. Whether to include metadata in the telemetry (InstanceID, Hostname, ResourceARN)
  - This field is optional and defaults to `False`
- **AWS_XRAY_TELEMETRY_HOSTNAME** `string` : Telemetry - Hostname. Sets the Hostname included in the telemetry.
  - This field is optional
- **AWS_XRAY_TELEMETRY_INSTANCE_ID** `string` : Telemetry - Instance ID. Sets the InstanceID included in the telemetry.
  - This field is optional
- **AWS_XRAY_TELEMETRY_RESOURCE_ARN** `string` : Telemetry - Resource ARN. Sets the Amazon Resource Name (ARN) included in the telemetry.
  - This field is optional
- **AWS_XRAY_TELEMETRY_CONTRIBUTORS** `string[]` : Telemetry - Contributors. List of X-Ray component IDs contributing to the telemetry (ex. for multiple X-Ray receivers: awsxray/1, awsxray/2)
  - This field is optional
- **AWS_XRAY_INDEX_ALL_ATTRIBUTES** `boolean` : Index All Attributes. Enable or disable conversion of all OpenTelemetry attributes to X-Ray annotations.
  - This field is optional and defaults to `False`
- **AWS_XRAY_INDEXED_ATTRIBUTES** `string[]` : Indexed Attributes. List of attribute names to be converted to X-Ray annotations.
  - This field is optional

<Note>
  **Traces and logs correlation**

  AWS X-Ray can be integrated with CloudWatch Logs to correlate traces with logs.

  For this integration to work, the X-Ray segments must have the AWS Property `cloudwatch_logs` set. This property is set using the AWS X-Ray exporter with the following values that are evaluated in this order:

  1. `aws.log.group.arns` resource attribute.
  2. `aws.log.group.names` resource attribute.
  3. `aws_log_groups` configuration property.

  `aws.log.group.arns` and `aws.log.group.names` are slice resource attributes, alternatively those resource attributes can be set using the [OTEL_RESOURCE_ATTRIBUTES environment variable](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#specifying-resource-information-via-an-environment-variable).

  To set multiple log group names / log group arns, you can use `&` to separate them.<br />
  For example 3 log groups: `log-group1`, `log-group2`, and `log-group3` are set in the following command:

  ```bash
  export OTEL_RESOURCE_ATTRIBUTES="aws.log.group.names=log-group1&log-group2&log-group3"
  ```
</Note>

### Adding Destination to Odigos

There are two primary methods for configuring destinations in Odigos:

##### **Using the UI**

<Steps>
  <Step>
    Use the [Odigos CLI](https://docs.odigos.io/cli/odigos_ui) to access the UI
    ```bash
    odigos ui
    ```
  </Step>
  <Step>
    Click on `Add Destination`, select `AWS X-Ray` and follow the on-screen instructions
  </Step>
</Steps>

##### **Using Kubernetes manifests**

<Steps>
  <Step>
    Save the YAML below to a file (e.g. `xray.yaml`)
    ```yaml
    apiVersion: odigos.io/v1alpha1
    kind: Destination
    metadata:
      name: xray-example
      namespace: odigos-system
    spec:
      data: {}
      destinationName: xray
      signals:
      - TRACES
      type: xray
    ```
  </Step>
  <Step>
    Apply the YAML using `kubectl`
    ```bash
    kubectl apply -f xray.yaml
    ```
  </Step>
</Steps>